$(H

------------------------------------------------------------------------
(c) Copyright  1992 to Current Year  AVEVA Solutions Limited

Macro:   FSYSTEM                                $Revision: 1.99 $
Author:  NEALE MORRIS

Last modified by $Author: nrh $ on $Date: 2003/02/26 09:54:46 $

Macro Generic Type: Form Definitions

------------------------------------------------------------------------

$)
$(D
Arguments: <appnam>
        1 - Application Name
$)

-- set default arguments
$d1=GEN

-- Initialise Variables
var !appnam (upcase(|$1|))
!project = current project
!isGlobal = !project.isGlobal()

-- find out if MMS is active
 
   !mmsTest = !!mmsIsThis3dmmProj()
    
-- find out if ASPECT Comparator is available
 
   if(defined(!!ASPCOMPRUN) and !!ASPCOMPRUN.neq('')) then
     !aspTest = TRUE
   else
     !aspTest = FALS
   endif
 
if(defined(!!edgPosCntrl)) then
  !positionType   = !!edgPosCntrl.type
else
  var !mainBar evar PDMSPOSITIONMAINBAR
  if(!mainBar.empty().not()) then
    !positionType = 'MAINBAR'
  else
    !positionType = 'FREE'
  endif
endif

!iconSize = !!comSysOpt.iconSize()
!mainToolBar = !!comSysOpt.mainToolBar()

-- load penetrations application if necessary
-- this is done here, to avoid loading it at startup time
if (!appnam ne 'GEN' and undefined(!!cdPenCla)) then
  CALLPEN  INIT
  handle ANY
    var !!cdLnPene false
  endhandle
endif

-- Get module name
-- used to prevent model editor gadgets appearing in Design Compare
!inModule = !!module().appkey

-- Process data into an input array for the relevant application
do !i indices !!cdApplications

  var !info split |$!!cdApplications[$!i]| |\|
  var !appl (trim(|$!info[1]|))  $* Directory
  var !desc (trim(|$!info[2]|))  $* Description
  var !fnam (trim(|$!info[3]|))  $* Form
  var !call (trim(|$!info[4]|))  $* Callback
  var !swap $!info[5]            $* Swap flag
  var !asso (trim(|$!info[6]|))
  var !mdes (trim(|$!info[7]|))

  -- Remove Undefined Variables
  if(|$!asso| eq ||) then
    var !asso delete
  endif
  if(|$!mdes| eq ||) then
    var !mdes delete
  endif

  -- If appl is same as passed set title only
  if(|$!appl| eq |$!appnam|) then

    var !title |Design - $!desc Application - VANTAGE PDMS|
    var !form  |$!fnam|
    var !adesc |$!desc|
    var !lflg  (trim(|$!info[9]|))  $* Lite Bar menu flag

    !rebuildMacro = '$m/%PDMSUI%/DES/GEN/FSYSTEM ' + !appl

  -- Else add other applications to list
  else

    -- If associated, then set vnam to menu number and set menu number
    if(defined(!asso)) then
      var !vnam         |!menu$!asso|

      -- If menu has not been defined before, then define an entry for it
      var !mnam |!menu[$!asso]|
      if(undefined($!mnam)) then
        var !menu[$!asso] |$!mdes|
        var !data append  |add '$!mdes' menu _menu$!asso|
      endif

    -- Use default name
    else
      var !vnam |!data|

    endif

    -- XAPPLOAD controls switching between applications
    var $!vnam raw append |add '$!desc$N...' 'CALLIB XAPPLOAD DES $<$!appl$> $<$!fnam$> $<$!call$> $<$!swap$> false $<$!desc$>'|

  endif

enddo

-- Define Form
setup form  $!form at xr 0 yr 0 MAIN

  title     |$!title|
  init      |$M/%PDMSUI%/DES/$!appnam/ISYSTEM|
  iconTitle |Design - VANTAGE PDMS|
  revision  | $$Revision: 1.99 $ |

  member .iconSize is REAL
  member .mainToolBar is BOOLEAN
  member .rebuild is STRING

  $* Main bar Menu
  bar
    add |Design|    _sysDes
    add |Display|   _sysView
    -- add |<remove>|  _sysGphx
    -- do not add new core model editor menus if in DESCOMP
    if(!inModule neq |cmp|) then
      add |Edit|      _coreEditMenu
      add |View|      _coreViewMenu
      add |Selection| _coreSelectMenu
    endif
    add |Query|     _sysQry
    add |Settings|  _sysSet
    add |Utilities| _sysUtil
    -- Michael modify   
      $M /%PDMSUI%/DES/GEN/TOOLKIT BAR
      handle ANY
      endhandle
          
    add |Create|    _sysCrt
    add |Modify|    _sysMod
    add |Delete|    _sysDel
    -- Bar pull downs for Application
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR bar for application
      $M/%PDMSUI%/DES/$!appnam/DBAR BAR
      handle ANY
      endhandle
    endif
    add window
    add help
    $M /%PDMSUI%/DES/GEN/UEPSI BAR
  exit
  -- Design Menu
  menu _sysDes
    add |Save Work       |      |CALLG MSAVEW|
    add |Get Work        |      |GETWORK|
    add |Extract Control...|    |call !!admExtractCntrl()|
    add |Session Comment... |   |show !!msgsavework|
    add SEPARATOR
    -- Application Definitions
    do !add values !data
      $!add
    enddo
    add SEPARATOR
    add |Modules|   menu _modules
    add sep
    add |Exit|               |CALLIB XEXIT $<CALLSPL MENDSPOOL$>|
  exit

  -- View Menu
  menu _sysView
    add |Graphical View|      '!!gphViews.addDesign()'
    add |View Control...|     'show !!gphControl'
    add |Plot View...|        form !!plotView
    add sep
    add |Browser...|          |EXPLORER SHOW|
    add |Members...|          |CALLIB UFORMS MEMB _CDCMEMBER FREE|
    add |Advanced Members...| |CALLIB UFORMS MEMB _CDCADVMEMBER FREE|
    add |Drawlist...|         |CALLIB UFORMS MEMB _CDADDREM FREE|
    add sep
    add |Command Line...|     |show _cadcBth free|
    add sep
    add |Save|                menu _sysFSave
    add |Restore|             menu _sysFLoad
    -- Application Display
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR Display for application
      $M/%PDMSUI%/DES/$!appnam/DBAR DISPLAY
      handle ANY
      endhandle
    endif
  exit

-- dummy menu contents - these are filled in by the application
  menu _coreViewMenu
  exit
  menu _coreEditMenu
  exit
  menu _coreSelectMenu
  exit
 
  -- Graphical View
  menu _sysGphViews
    add 'Design (EDG)' '!!gphViews.addDesign()'
    add 'Navigate'     '!!gphViews.addNavigate()'
  exit

  -- Save Files
  menu _sysFSave
    add |Forms & Display|           |CALLIB XRECREATE SAVE COMB|
    add |Forms & Display As...|     |CALLIB XRECREATE SAVE COMBAS|
    add |Forms As...|               |CALLIB XRECREATE SAVE FORMS|
    add |Display As...|             |CALLIB XRECREATE SAVE DISPLAY|
  exit

  -- Restore Files
  menu _sysFLoad
    add |Forms & Display|           |CALLIB XRECREATE RESTORE COMB|
    add |Forms & Display From...|   |CALLIB XRECREATE RESTORE COMBAS|
    add |Forms From...|             |CALLIB XRECREATE RESTORE FORMS|
    add |Display From...|           |CALLIB XRECREATE RESTORE DISPLAY|
  exit

  -- Model Menu
  menu _sysGphx
    add |Axes...|           form _CDAXES
    add |Pins...|           form _CDPIN
    add |Measure...|        |CALLIBD XMEASURE|
    add |Tagging...|        form _CDMARK
    add |Identify...|       form _CDIDENT
  exit

  -- Query Menu
  menu _sysQry
    add |General...|        |CALLIBQ XATTFORM _CDGENQ FREE|
    add |Attributes...|     |CALLIBQ XATTFORM _CDCQUERYC FREE|
    add |Properties...|     |!!comProp(!!ce, 'QUERY')|
    add sep
    add |Project|           menu _sysProj
    add |DB Changes...|     |call !!displayOutput('Change')|
    add sep
    add 'Measure Distance...' |!!gphViews.measure('DISTANCE')|
--    add 'Measure Angle...' |!!gphViews.measure('DISTANCE')|
    add 'Axes...' |!!gphViews.tag('AXES')|
--    add 'Tagging...' |!!gphViews.measure('DISTANCE')|
--    add 'Identify...' |!!gphViews.measure('DISTANCE')|

    -- Application Query
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR QUERY for application
      $M/%PDMSUI%/DES/$!appnam/DBAR QUERY
      handle ANY
      endhandle
    endif
  exit

  -- Project listings
  menu _sysProj
    add |Status...|          form !!userStatus
    add |Users...|           form !!userList
    add |Teams...|           form !!teamList
    add |DBs...|             form !!dbList
    add |MDBs...|            form !!mdbList
    add |Stamps...|          form !!stampList
    add |User Rights...|     form !!qryUserAcr
  exit

  -- Settings Menu
  menu _sysSet
    add 'System...'              '!!comSysOpt.edit()'
    add 'Graphics'               menu _sysGph
    add |Naming...|              |!!namOpt.edit()|
    add |Units...|               form !!comFormatsSelect
    add sep
    add |Clasher|                menu _sysClam
    add |Properties...|          '!!comPropOpt.edit()'
    add sep
    add |Pick Filters|           menu _sysFilters
    add sep
    add |Comparison Date...| |!!compdate('MENU','SET')|

    -- System General Settings
    if ($!!cdLnDesAdmin) then
      add sep
      add 'Purposes'             menu _sysPurp
      -- add 'Draft'                menu _sysDraft
      add sep
      add |Check Defaults...|    form _CDCCHKDFLTS
    endif
    -- Application Settings
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR SETTINGS for application
      $M/%PDMSUI%/DES/$!appnam/DBAR SETTINGS
      handle ANY
      endhandle
    endif
  exit

  -- Purpose Menu
  menu _sysPurp
    add |Define...|             |CALLIBQ XATTFORM _CDCDEFPURP|
    add |Relationships...|      |CALLIBQ XATTFORM _CDCSETPURP|
  exit

  -- Draft Menu
  -- menu _sysDraft
  --  add |Edge Defaults...|  '!!draDunion.edit()'
  -- exit

  -- Graphics
  menu _sysGph
    add 'Picking...'               'show !!edgSettings'
    add 'View...'                  '!!gphViewOpt.edit()'
    add 'Representation...'        '!!gphRepOpt.edit()'
    add 'Colour...'                '!!gphColOpt.edit()'
    add 'Aid CE Arrow...'          'show !!aidCeArrow'
    -- Application Graphics
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR Graphics for application
      $M/%PDMSUI%/DES/$!appnam/DBAR GRAPH
      handle ANY
      endhandle
    endif
  exit

  -- Clasher Settings
  menu _sysClam
    add |Auto Clash| toggle 'CALLCL XMENUAUTO'
    add |Defaults...| form _CDCLADEF
    add |Obstruction| menu _sysObst
  exit

  -- Clasher Obstruction
  menu _sysObst
    add |List...|   |CALLIB UFORMS MEMB _CDCLAOBS|
    add |Limits...| form _CDCLALIM
  exit

  -- Filter setting Menu
  menu _sysFilters
    add 'Elements...' '!!edgElementFilter.edit()'
    add 'Plines...'   '!!edgPlineFilter.edit()'
    add 'Ppoints...'  '!!edgPointFilter.edit()'
  exit

  -- Utilities Menu
  menu _sysUtil
    add |Data Consistency...|  form _CDDATCHK
    add |Data Checker...|      |show !!chkStoreView|
    add |Clashes...|           |CALLCL MSHOWCLA|
    if(!aspTest) then    
       add |ASPECT Comparator...| |!!aspComparator('')| 
       add |PDMS Clash manager|   menu _PCLAMMENU
    endif
    add |Autonaming|           menu _sysName
    if(!mmsTest) then   
      add sep
      add |Model Management Start Up... |      |!!mmsCall3dmm()|
      add |Model Management PDMS Menu...|      |show !!mmsMainMenu|
    endif
    add sep
    add 'Working Plane...'    'show !!edgWorkingPlane'
    add 'Constructs...'       'show !!aidConstructs'
    add sep
    add |Lists...|            |CALLIB SHOWFORM _CDCLIST|
    add |Claimlists...|        |show !!lstClaim|
    add |DB Listing...|        |call !!displayOutput('Datal')|
    if (!isGlobal) then
      add sep
      add |Transactions...|    |show !!glbTransactions|
    endif
--    add |Extracts|              menu _sysExt
    add sep
    add |Reports|              menu _sysRep
    add |Quick Reports...|     |show !!rptQuick|
    add |Export|               menu _sysRxp
    add sep
    add |Reference Data...|   |CALLOUT INIT
        show _CDLOUTAPP free|
    add |$!adesc$n...|        |CALLG XUTILITIES $$<$!adesc$$> $$<$!appnam$$>|
    -- Application Utilities
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR Utilities for application
      $M/%PDMSUI%/DES/$!appnam/DBAR UTILS
      handle ANY
      endhandle
    endif
  exit

  --Extracts Menu
--   menu _sysExt
--     add |Full|                 menu _sysExf
--     add |Partial|              menu _extComs
--   exit
--
--
--   --Extracts Menu
--   menu _sysExf
--     add |Refresh|              |!!admExtractCom.init('REFRESH')|
--     add |Release|              |!!admExtractCom.init('RELEASE')|
--     add |Flush|                |!!admExtractCom.init('FLUSH')|
--     add |Drop|                 |!!admExtractCom.init('DROP')|
--     add |Issue|                |!!admExtractCom.init('ISSUE')|
--   exit
--
--   menu _extComs
--     add |Refresh|              menu _extrTyp1
--     add |Release|              menu _extrTyp2
--     add |Flush|                menu _extrTyp3
--     add |Drop|                 menu _extrTyp4
--     add |Issue|                menu _extrTyp5
--   exit
--
--   -- Yes, there is probably an easier way of doing this!
--
--   menu _extrTyp1
--     add |CE|           |!!admExtractCe('Refresh',CE,FALSE,TRUE)|
--     add |Identified|   |!!admExtractMulti('Refresh','PICK')|
--     add |List|         |!!admExtractMulti('Refresh','LIST')|
--     add |Name...|      |!!admExtractName.init('Refresh')|
--     add |Members|      menu _extRme1
--   exit
--
--   -- Delete Members Menu
--   menu _extRme1
--     add |Selection...| |!!admExtractMem.init('Refresh')|
--     add |All|          |!!admExtractCe('Refresh',CE,TRUE,TRUE)|
--   exit
--
--   menu _extrTyp2
--     add |CE|           |!!admExtractCe('Release',CE,FALSE,TRUE)|
--     add |Identified|   |!!admExtractMulti('Release','PICK')|
--     add |List|         |!!admExtractMulti('Release','LIST')|
--     add |Name...|      |!!admExtractName.init('Release')|
--     add |Members|      menu _extRme2
--   exit
--
--   -- Delete Members Menu
--   menu _extRme2
--     add |Selection...| |!!admExtractMem.init('Release')|
--     add |All|          |!!admExtractCe('Release',CE,TRUE,TRUE)|
--   exit
--
--   menu _extrTyp3
--     add |CE|           |!!admExtractCe('Flush',CE,FALSE,TRUE)|
--     add |Identified|   |!!admExtractMulti('Flush','PICK')|
--     add |List|         |!!admExtractMulti('Flush','LIST')|
--     add |Name...|      |!!admExtractName.init('Flush')|
--     add |Members|      menu _extRme3
--   exit
--
--   -- Delete Members Menu
--   menu _extRme3
--     add |Selection...| |!!admExtractMem.init('Flush')|
--     add |All|          |!!admExtractCe('Flush',CE,TRUE,TRUE)|
--   exit
--
--   menu _extrTyp4
--     add |CE|           |!!admExtractCe('Drop',CE,FALSE,TRUE)|
--     add |Identified|   |!!admExtractMulti('Drop','PICK')|
--     add |List|         |!!admExtractMulti('Drop','LIST')|
--     add |Name...|      |!!admExtractName.init('Drop')|
--     add |Members|      menu _extRme4
--   exit
--
--   -- Delete Members Menu
--   menu _extRme4
--     add |Selection...| |!!admExtractMem.init('Drop')|
--     add |All|          |!!admExtractCe('Drop',CE,TRUE,TRUE)|
--   exit
--
--   menu _extrTyp5
--     add |CE|           |!!admExtractCe('Issue',CE,FALSE,TRUE)|
--     add |Identified|   |!!admExtractMulti('Issue','PICK')|
--     add |List|         |!!admExtractMulti('Issue','LIST')|
--     add |Name...|      |!!admExtractName.init('Issue')|
--     add |Members|      menu _extRme5
--   exit
--
--   -- Delete Members Menu
--   menu _extRme5
--     add |Selection...| |!!admExtractMem.init('Issue')|
--     add |All|          |!!admExtractCe('Issue',CE,TRUE,TRUE)|
--   exit

  -- Autonaming
  menu _sysName
    add |CE only|      |call !!autoNameCe(false)|
    add |CE offspring| |call !!autoNameCe(true)|
  exit

  -- Report menu
  menu _sysRep
    add |Run...|    |CALLIBR XREPSEL RUN|
    add |Create...| |CALLIBR XREPDEF|
    add |Modify...| |CALLIBR XREPSEL MODIFY|
    add |Delete...| |CALLIBR XREPSEL DELETE|
  exit


  -- Review Export
  menu _sysRxp
    add |Run...|            |CALLXR XEXPMAIN RUN|
    add |Create...|         |CALLXR XEXPMAIN CREATE|
    add |Modify...|         |CALLXR XEXPMAIN MODIFY|
    add |Delete...|         |CALLXR XEXPMAIN DELETE|
    add |Dump Attributes...| |CALLXR INIT
        show _CDXATTDUMP|
    add |Select Driver ...|  |CALLXR INIT
        show _CDXDRVSEL|
  exit

  -- Create Menu
  menu _sysCrt
    -- Don't display if lite bar
    if(not $!lflg) then
      add |Copy|              menu _sysCopy
      add |Site...|         |CALLG XCRTPURP SITE $$<Create Site$$>|
      add |Zone...|         |CALLG XCRTPURP ZONE $$<Create Zone$$>|
      add |Group...|          form _CDGROU
    endif

    -- Application Create
    if(|$!appnam| neq |GEN|) then

      -- Add DBAR Create for application
      $M/%PDMSUI%/DES/$!appnam/DBAR CREATE
      handle ANY
      endhandle
    endif
  exit

  -- Copy
  menu _sysCopy
    add |Offset...|   |CALLIB UFORMS COPY _CDCOPYXYZ|
    -- add |Along...|  |CALLIB UFORMS COPY _CDCOPYDIR|
    add |Rotate...|   |CALLIB UFORMS COPY _CDCOPYROT|
    add |Mirror...|   |CALLIB UFORMS COPY _CDMIRROR|
  exit

  -- Modify Menu
  menu _sysMod

   $* Don't display if lite bar
    if(not $!lflg) then
      add |Name...|              form _CDNAME
    endif
      add |Attributes...|        |CALLIBQ INIT
          show _CDCATTDEF|
      add |Attributes Global...| |CALLIBQ INIT
          show _CDCATTGLOB|
      add |Angle...| |call !!dbeElementAngle(!!ce)|
    if(not $!lflg) then
      add |Like|                 menu _sysLike
      add |Lock...|              form _CDLOCK
      add |Hierarchy|            menu _sysHier $* Into Modify
      add |Group...|             |CALLIB UFORMS MEMB _CDGROUMOD|
    endif
    add sep
    add |Properties...|         |!!comProp(!!ce, 'EDIT')|
    add |Re-evaluate Rules|     |CALLIBD MEVAL|
    add |Unlink from Original|  |!!tmpUnlinkFromOriginal(!!ce)|
    -- Application Modify
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR Modifies for application
      $M/%PDMSUI%/DES/$!appnam/DBAR MODIFY
      handle ANY
      endhandle
    endif
  exit

  -- Hierarchy menu
  menu _sysHier
    add |Include...|       |CALLIB UFORMS MEMB _CDCINCLUDE|
    add |Reverse Order|    |CALLIB MREOREV|
    add |Reorder...|       form _CDCREOAFT
 exit


  -- Copy Attributes Like
  menu _sysLike
    add |picked element|   |CALLG MCOPYLIKE ID   CE|
    add |current element|  |CALLG MCOPYLIKE CE   ID|
    add |CE into list|     |CALLG MCOPYLIKE CE LIST|
  exit

  -- Deletion Menu
  menu _sysDel
    if(not $!lflg) then
      add |CE|           |CALLIB MDELCE CE true|
      add |Identified|   |CALLIB MDELMULTI PICK|
      add |List|         |CALLIB MDELMULTI LIST|
      add |Name...|      |show _CDCDELNAME|
      -- add |3D Volume|  |CALLG MDEL3D|
      add |Members|      menu _sysDelMem
      -- add |File...|    |CALLIB XRM-OS|
    endif
    -- Application Delete
    if(|$!appnam| neq |GEN|) then
      -- Add DBAR DELETEs for application
      $M/%PDMSUI%/DES/$!appnam/DBAR DELETE
      handle ANY
      endhandle
    endif
  exit

  -- Delete Members Menu
  menu _sysDelMem
    add |Selection...| form _CDCDELSEL
    add |All|          |CALLIB MDELCE CE false $$<$$> true|
  exit

  -- Load Menus for Application
  -- Michael modify
    $M/%PDMSUI%/DES/GEN/TOOLKIT MENU
    handle ANY
    endhandle        
  if(|$!appnam| neq |GEN|) then
    -- Add DBAR menu for application
    $M/%PDMSUI%/DES/$!appnam/DBAR MENU
    handle ANY
    endhandle
  endif
  $M/%PDMSUI%/DES/GEN/UEPSI MENU
  $* Build Menus
  do !indx indices !menu
    var !vnam |!menu$!indx|
    menu _menu$!indx
      do !add values $!vnam
        $!add
      enddo
    exit
  enddo

  -- define toolbar icons
  hdist 0
  valign centre
  -------------------------------------------
  -- Main toolbar
  -------------------------------------------

  if (!mainToolBar) then
    -- get work
    button .mtbGetWork at x0 ymax tooltip 'Get Work' pixmap width $!iconSize height $!iconSize callback |GETWORK|

    -- save work
    button .mtbSaveWork at xmax tooltip 'Save Work' pixmap width $!iconSize height $!iconSize callback |CALLG MSAVEW|

    -- Add CE to drawlist
    button .mtbAddCe at xmax+0.4 tooltip 'Add CE to Drawlist' pixmap width $!iconSize height $!iconSize callback |CALLG MADDELEM CE|

    -- Remove CE from drawlist
    button .mtbRemoveCe at xmax tooltip 'Remove CE from Drawlist' pixmap width $!iconSize height $!iconSize callback |REMOVE CE|
 
----------------------------------------------------------------------------------------------------------------------------------
--  DO NOT ATTEMPT TO MODIFY THE NAMES OR DEFINITIONS OF ANY .core BUTTONS.  THESE ARE CONTROLLED BY PDMS DESIGN CORE. 
----------------------------------------------------------------------------------------------------------------------------------
---- Graphical interaction model editor, undo & redo buttons
  if( !inModule neq 'cmp') then
    !modifyOn     = !!pml.getPathName('editmodel' & !iconSize & '.png')
    !modifyOff    = !!pml.getPathName('noteditmodel' & !iconSize & '.png') 
    !undoIcon     = !!pml.getPathName('activeundo' & !iconSize & '.png')
    !redoIcon     = !!pml.getPathName('activeredo' & !iconSize & '.png')
    !greyundoIcon = !!pml.getPathName('inactiveundo' & !iconSize & '.png')
    !greyredoIcon = !!pml.getPathName('inactiveredo' & !iconSize & '.png')

    button .coreModifyButton toggle at xmax+0.4 tooltip 'Model Editor'  pixmap /$!<modifyOff> /$!<modifyOn>                   width $!iconSize height $!iconSize
    button .coreUndoButton at xmax+0.4          tooltip 'Undo'          pixmap /$!<undoIcon>  /$!<undoIcon> /$!<greyundoIcon> width $!iconSize height $!iconSize
    button .coreRedoButton at xmax              tooltip 'Redo'          pixmap /$!<redoIcon>  /$!<redoIcon> /$!<greyredoIcon> width $!iconSize height $!iconSize
    !this.coreUndoButton.active = false
    !this.coreRedoButton.active = false
    !this.coreModifyButton.val  = false
  endif

    -- single navigate
    button .mtbNavigate at xmax+0.4 tooltip 'Navigate to Element' pixmap width $!iconSize height $!iconSize callback |!!gphViews.navigate()|

    -- measure
    button .mtbMeasure at xmax tooltip 'Measure' pixmap width $!iconSize height $!iconSize callback |!!gphViews.measure('DISTANCE')|

    -- axes on CE
    button .mtbAxes at xmax tooltip 'Display Axes on CE' pixmap width $!iconSize height $!iconSize callback |!!gphViews.tag('AXES')|

    -- Delete CE
    button .mtbDeleteCe at xmax+0.4 tooltip 'Delete CE' pixmap width $!iconSize height $!iconSize callback |CALLIB MDELCE CE true|

    -- List Creation/modification
    button .mtbCreateList at xmax+0.4 tooltip 'Create/Modify Lists' pixmap width $!iconSize height $!iconSize callback |CALLIB SHOWFORM _CDCLIST|

    -- Active List/Collection
    option .list at xmax tooltip 'Active List' callback |CALLIB ILIST $$_list| width 15

    -- Auto Clasher toggle
    !autoCOffPix = !!pml.getPathName('autoclashoff' & !iconSize & '.png')
    !autoCOnPix  = !!pml.getPathName('autoclashon' & !iconSize & '.png')
    !sysClaXDist = !iconSize - (!iconSize / 4) + 1
    button .sysCla toggle at xmax+$!sysClaXDist tooltip 'Auto Clash' pixmap unsel /$!<autoCOffPix> sel /$!<autoCOnPix> width $!iconSize height $!iconSize callback |CALLCL XAUTO $$_sysCla|
-- show Command line
    button .mtbCommandline at xmax+2 tooltip 'Command Line' pixmap width $!iconSize height $!iconSize callback |CALLIB SHOWFORM _cadcbth|
    button .mtbQueryattribute at xmax tooltip 'Query Attribute' pixmap width $!iconSize height $!iconSize callback |q att|
    button .mtbAddreference at xmax+1 tooltip 'Add Reference' pixmap width $!iconSize height $!iconSize callback |$m %pmllib%\toolkit\addreference.mac|
    button .mtbCreathanger at xmax tooltip 'Logic H&S' pixmap width $!iconSize height $!iconSize callback |show !!creathanger|
    button .mtbGotosite at xmax+1 tooltip 'Goto my Site' pixmap width $!iconSize height $!iconSize callback |$m %pmllib%\toolkit\gotosite.mac|
    button .mtbFilter at xmax tooltip 'Filter' pixmap width $!iconSize height $!iconSize callback |show !!filter|

  -- Positioning data
    if(!positionType eq 'MAINBAR') then

      -- Working Plane
      !wpOn  = !!pml.getPathName('workingplaneon' & !iconSize & '.png')
      !wpOff = !!pml.getPathName('workingplaneoff' & !iconSize & '.png')

      button .wp toggle at xmax+1 ymin.mtbGetWork tooltip 'Turn working plane on/off' pixmap unsel /$!<wpOff> sel /$!<wpOn> width $!iconSize height $!iconSize
      !this.wp.active       = false

      -- Pick Types  (Element, Pline, etc)
      option .pick     width  8
      !this.pick.active     = false

      -- Pick Option (position deriving mechanism)
      option .pickType width 10
      !this.pickType.active = false

      -- Explicit Positioning Form
      if(undefined(!!edgFormat)) then
        !!edgFormat = object FORMAT()
      endif
      text   .input    width 14 is REAL format !!edgFormat
      !this.input.active    = false

      -- Explicit position pick form
      !explicitIcon         = !!pml.getPathName('xyz' & !iconSize & '.png')
      button .explicit tooltip 'Explicit Position' pixmap /$!<explicitIcon> width $!iconSize height $!iconSize callback |show !!edgEPosition free|
      !this.explicit.active = false
    endif

  endif

  -------------------------------------------
  -- Application toolbar
  -------------------------------------------
  -- Load any application specific gadgets
  if(|$!appnam| neq |GEN|) then
    -- Add DBAR Data for application
    $M/%PDMSUI%/DES/$!appnam/DBAR DATA
    handle ANY
    endhandle
  endif

exit

if (!form.substring(1, 1) eq '_') then
  !formObjName = '!!' + !form.substring(2)
  !formObj = $!formObjName
else
  !formObj = $!form
endif

-- set form members
!formObj.iconSize = !iconSize
!formObj.mainToolBar = !mainToolBar
!formObj.rebuild = !rebuildMacro

-- set the clasher settings menu callback
!formObj.sysClam.callback = 'CALLCL XSETAUTO $!form'

-- build the modules menu
!!moduleMenus(!formObj)

-- Preload these Forms (Probably an overhead but h e y h o !
PML LOAD FORM !!admExtractCom
PML LOAD FORM !!admExtractName
PML LOAD FORM !!admExtractMem


-------------------------------------------
-- Main toolbar pixmaps
-------------------------------------------
if (!mainToolBar) then
  !formObj.mtbGetWork.addPixmap(!!pml.getPathName('getwork' & !iconSize & '.png'))
  !formObj.mtbSaveWork.addPixmap(!!pml.getPathName('savework' & !iconSize & '.png'))
  !formObj.mtbAddCe.addPixmap(!!pml.getPathName('addce' & !iconSize & '.png'))
  !formObj.mtbRemoveCe.addPixmap(!!pml.getPathName('removece' & !iconSize & '.png'))
  !formObj.mtbNavigate.addPixmap(!!pml.getPathName('navigate' & !iconSize & '.png'))
  !formObj.mtbMeasure.addPixmap(!!pml.getPathName('measure' & !iconSize & '.png'))
  !formObj.mtbAxes.addPixmap(!!pml.getPathName('axes' & !iconSize & '.png'))
  !formObj.mtbDeleteCe.addPixmap(!!pml.getPathName('deletece' & !iconSize & '.png'))
  !formObj.mtbCreateList.addPixmap(!!pml.getPathName('createlist' & !iconSize & '.png'))
  !formObj.mtbCommandline.addPixmap(!!pml.getPathName('commandline' & !iconSize & '.png'))
  !formObj.mtbQueryattribute.addPixmap(!!pml.getPathName('queryattribute' & !iconSize & '.png'))
  !formObj.mtbAddreference.addPixmap(!!pml.getPathName('addreference' & !iconSize & '.png'))
  !formObj.mtbCreathanger.addPixmap(!!pml.getPathName('creathanger' & !iconSize & '.png'))
  !formObj.mtbGotosite.addPixmap(!!pml.getPathName('gotosite' & !iconSize & '.png'))
  !formObj.mtbfilter.addPixmap(!!pml.getPathName('filter' & !iconSize & '.png'))
endif

-- Help Info
-- Application specific help not avail this release
-- FMINFO HELP FILE /%PDMSUI%/DES/HELP/DESIGN.hlp XREF /%PDMSUI%/DES/HELP/DESIGN.h


$* End of Code
$.
